import  { chartColors } from "@/views/dataview/setting/chartTheme"

export const animationsClass = (animations: string[]) => {
    if (animations.length) {
        return `animate__animated  animate__${animations[0]}`
    }
    return ''
}

/**
 * * 合并基础颜色和自定义颜色
 * @param chartDefaultColors
 * @param customColor
 * @returns
 */
export const colorCustomMerge = (customColor?:any[])=>{
    type FormateCustomColorType = {
        [T: string]: {
        color: string[]
        name: string
        }
    }
    const formateCustomColor :FormateCustomColorType= {}
    customColor?.forEach((item:any)=>{
        formateCustomColor[item.id] = {
            color:item.color,
            name:item.name
        }
    })
    return {...formateCustomColor,...chartColors}
}